package com.ztesoft.huangfu.learning.springboot.springbootvalidate.annotation;

import com.ztesoft.huangfu.learning.springboot.springbootvalidate.utils.DateTimeValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.RetentionPolicy.RUNTIME;


/**
 * Created with IntelliJ IDEA.
 * Author: huangfu.daohui
 * Date: 2018/6/8
 * Time: 21:33
 * Version: 1.0
 * Description: 自定义注解
 **/
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RUNTIME)
@Constraint(validatedBy = DateTimeValidator.class)
public @interface DateTime {
    String message() default "格式错误";

    String format() default "yyyy-MM-dd";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

}
